package com.hemaapp.yjnh.bean;

import java.io.Serializable;

import org.json.JSONException;
import org.json.JSONObject;

import xtom.frame.XtomObject;
import xtom.frame.exception.DataParseException;

/**
 * 首页广告和模块广告图片
 */
public class AdImage extends XtomObject implements Serializable {

	private String id;//
	private String keytype;// 广告链接类型  1：商品 2：田家/商家 3：图文详情
	private String type;//商品类型
	//0唠嗑帖子；1田家农货；2有机；3地标；4村游；5田家日志；6特产；9乐乐；
	//71走走房车露营；72走走自驾车露营；73走走帐篷露营；74走走商品区；75走走房车；
	//81苗木；82花卉；83家电；84日用品；10众农
	private String keyid;// 关联主键	keytype=1 商品主键；keytype=2 田家/商家主键；keytype=3 可以为空
	private String role;// 商家类型 
	//0普通用户;1田家用户;2地标商家;3村游商家;4省级代理;5运营商;6乐乐商家;
	//7特产商家;8粮库商家;11走走露营商家;12走走房车商家;21苗木;22花卉;23家电;24日用商品
	private String imgurl;// 广告图片
	private String imgurl_detail;// 广告详情图,  keytype=3时广告详情图片，其他可以为空
	private String regdate;// 发布日期
	private String orderby;// 排序规则		由大到小排序
	private String model;// 模块类型,该字段仅在模块广告中存在    1乐乐；2走走；3特产；4地标
	private String district_name;// 地区/民族名称,该字段仅在模块广告中存在     如："济南"，"汉族"
    private String parent_typeid;
    private String typeid;
    private String removeflag;
    private String starttime;
    private String endtime;

	public AdImage(JSONObject jsonObject) throws DataParseException {
		if (jsonObject != null) {
			try {
				id = get(jsonObject, "id");
				parent_typeid = get(jsonObject, "parent_typeid");
				typeid = get(jsonObject, "typeid");
				keytype = get(jsonObject, "keytype");
				type = get(jsonObject, "type");
				keyid = get(jsonObject, "keyid");
				role = get(jsonObject, "role");
				imgurl = get(jsonObject, "imgurl");
				imgurl_detail = get(jsonObject, "imgurl_detail");
				regdate = get(jsonObject, "regdate");
				orderby = get(jsonObject, "orderby");
				model = get(jsonObject, "model");
				district_name = get(jsonObject, "district_name");
				removeflag = get(jsonObject, "removeflag");
				starttime = get(jsonObject, "starttime");
                endtime = get(jsonObject, "endtime");

			} catch (JSONException e) {
				throw new DataParseException(e);
			}
		}
	}

    /**
	 * @return the id
	 */
	public String getId() {
		return id;
	}

	/**
	 * @return the keytype
	 */
	public String getKeytype() {
		return keytype;
	}

	public String getRole() {
		return role;
	}

	/**
	 * @return the type
	 */
	public String getType() {
		return type;
	}

	/**
	 * @return the keyid
	 */
	public String getKeyid() {
		return keyid;
	}

	/**
	 * @return the imgurl_detail
	 */
	public String getImgurl_detail() {
		return imgurl_detail;
	}

	/**
	 * @return the imgurl
	 */
	public String getImgurl() {
		return imgurl;
	}

	public String getOrderBy() {
		return orderby;
	}

	/**
	 * @return the regdate
	 */
	public String getRegdate() {
		return regdate;
	}

    public String getOrderby() {
        return orderby;
    }

    public String getModel() {
        return model;
    }

    public String getDistrict_name() {
        return district_name;
    }

    public String getParent_typeid() {
        return parent_typeid;
    }

    public String getTypeid() {
        return typeid;
    }

    public String getRemoveflag() {
        return removeflag;
    }

    public String getStarttime() {
        return starttime;
    }

    public String getEndtime() {
        return endtime;
    }
}
